package de.mmbbs;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;

public class BackDrop extends Basic2dObject {
	
	private static BackDrop instance;
	private static Bitmap bm;
	
	public BackDrop(Context context){
		super();
		bm = BitmapFactory.decodeResource(context.getResources(),R.drawable.backdrop2);
		
		super.setBitmap(bm);
		super.setPosition(0, 0);
	}
	
	public static BackDrop getInstance(Context context){
		if (instance == null){
			instance = new BackDrop(context);
		}
		return instance;
	}
	
	public void tick(){
		super.setPosition(0, 0);
	}
	
	public static void setSize(int width, int height){
		if (instance != null){
			if ((bm.getHeight() != height) || (bm.getWidth() != width)){
				bm = Bitmap.createScaledBitmap(bm, width, height, false);
			}
		}
	}
}
